from bs4 import BeautifulSoup
def get_res_html(res):
    form_data=res.json().get("description").get("form")

    bs = BeautifulSoup(form_data, "html.parser")
    url = bs.form.get("action")
    listall = bs.findAll("input")

    dic1 = {}
    for sing in listall:
        key = sing.get("name")
        value = sing.get("value")
        dic1[key] = value

    return [url,dic1]



if __name__ == '__main__':
        res={'status': 200, 'description': {'form': "<form name='easypaysubmit' id='easypaysubmit' target='_blank' method='post' action='http://121.43.169.97:8000/muser/publicRequests'><input name='Version' type='hidden' value='10'/><input name='CmdId' type='hidden' value='NetSave'/><input name='MerCustId' type='hidden' value='6000060007313892'/><input name='UsrCustId' type='hidden' value='6020240719153615'/><input name='OrdId' type='hidden' value='24071921110080723240'/><input name='OrdDate' type='hidden' value='20240719'/><input name='GateBusiId' type='hidden' value='B2C'/><input name='OpenBankId' type='hidden' value=''/><input name='DcFlag' type='hidden' value='D'/><input name='TransAmt' type='hidden' value='10000.00'/><input name='RetUrl' type='hidden' value='http://121.43.169.97:8081/trust/chinapnr/recharge/return/24071921110080723240'/><input name='BgRetUrl' type='hidden' value='https://www.baidu.com/'/><input name='OpenAcctId' type='hidden' value=''/><input name='CertId' type='hidden' value=''/><input name='MerPriv' type='hidden' value='18240'/><input name='ChkValue' type='hidden' value='-101'/><input name='CharSet' type='hidden' value='UTF-8'/></form><script>document.forms['easypaysubmit'].submit();</script>"}}
        print(get_res_html(res))
